package homework;

public class question22 {

	/**
	 * 题目：利用递归方法求5!。
	 */
	public static void main(String[] args) {
		int n = 5;
		long lVal = f(n);
		System.out.println("5!=" + lVal);

	}

	public static long f(int n) {
		long sum = 1;
		for (int i = 1; i <= n; i++) {
			sum *= i;
		}
		return sum;
	}

}
